<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>忘记密码</title>
<link type="text/css" rel="stylesheet" href="css/password.css" />
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="layui/css/layui.css">
<script type="text/javascript" src="admin/layui/layui.js"></script>    
    <script type="text/javascript">
    
    layui.use(['table','form','layer','laydate'], function(){
    	var table = layui.table;
    	  var form = layui.form;
    	  var layer = layui.layer;
    	  var laydate = layui.laydate;
    	  var $ = layui.$;
    })
$(document).ready(function () {
	var height=$(document).height();
	$('.main').css('height',height);
})


function User(){
		$.post("updatePassword",{
			username : $("#username").val(),
			password :$("#password").val(),
			password2 :$("#password2").val()
		},function(res){
			layer.msg("修改成功")
			window.location.href = "index.html";
		},"json")
	}
	function mima(){
        //获取用户输入的用户名
        var username = $("#username").val();
        //判断用户名是否为空
        if(username == "" || username == null){
        	layer.msg("用户名不能为空");
            //取消默认行为
            return false;
        }
        //获取用户输入的密码
        var password = $("#password").val();
        //判断密码是否为空
        if(password == "" || password==null){
        	layer.msg("密码不能为空");
            //取消默认行为
            return false;
        }
        var password2 = $("#password2").val();
        //判断密码是否为空
        if(password2 == "" || password2==null || password2!==password){
        	layer.msg("密码不一致");
            //取消默认行为
            return false;
        }
        
        User();
    };
</script>
</head>

<body>
<div class="main">
  <div class="main0">
     <div class="formBox">
       <h3>登录密码修改</h3>
       
       
       <div class="itembox itembox_2">
         <label>用户名 &nbsp;:</label>
         <input type="text" id="username" placeholder="请输入用户名" class="yz"></span>
         
       </div>
       <div class="itembox itembox_2">
         <label>登录密码&nbsp;:</label>
         <input type="text" id="password" placeholder="请输入新登录密码"></span>
       </div>
       <div class="itembox itembox_2">
         <label>确认密码&nbsp;:</label>
         <input type="text" id="password2" placeholder="请再次输入新密码"></span>
       </div>
       
       <div class="btnBox">
            <button onclick="mima()" type="button">下一步</button>
       </div>
     </div>
  </div>
</div>


</body>
</html>
